package cn.yunhe.interceptor;

import cn.yunhe.util.MyWebSocket;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.MethodFilterInterceptor;

import java.util.Map;

public class LanZang extends MethodFilterInterceptor {

    @Override
    protected String doIntercept(ActionInvocation invocation) throws Exception {
        ActionContext cxt=invocation.getInvocationContext();
        Map request= (Map) cxt.get("request");
        String text= (String) request.get("text");
        if ("妈的".equals(text)){
            text="**";
        }
        MyWebSocket myWebSocket= (MyWebSocket) invocation.getAction();

        return invocation.invoke();
    }
}
